<template>
  <view>
    <u-alert
        ref='notify' :title="title"
        :type="type" :description="description"
        v-show="show" @click="emitClick"
    ></u-alert>
  </view>
</template>

<script>
import appConfig from "../../api/appConfig";
import testData from "../../api/testData";

export default {
  name: "segPredictLogMonitor",
  props: {
    show: {
      default: true,
      type: Boolean
    },
    title: {
      default: 'testTitle',
      type: String
    },
    type: {
      default: 'success',
      type: String
    },
    description: {
      default: '',
      type: String
    }
  },
  mounted() {
    // this.insertToBody()
    // debugger.
  },
  methods: {
    emitClick(){
      this.$emit("click")
    },
    insertToBody() {
      // debugge
      const notify = this.$refs.notify
      const body = document.querySelector(".seg-content")
      body.insertBefore(notify, body.firstChild)
    }
  }
}
</script>

<style scoped>
  .seg-log {
    width: 150px;
    position: fixed;
    z-index: 9999;
    top: 15%;
    left: calc(50% - 75px)
  }
</style>
